import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 教练课程方案信息 */
export interface CoachPlan {
          id: number; // ID
          coachId?: number; // 教练ID
          servicePId?: number; // 授权服务分类ID（服务一级分类ID）
          serviceId?: number; // 授权服务分类ID（服务二级分类ID）
          auditStatus?: number; // 审核状态（字典：business_audit_status）
          sort?: number; // 排序
          peopleCount?: string; // 课程人数（字典：business_coach_service_people_count）
          serviceTime?: string; // 课程时间（字典：business_coach_service_time）
          price?: number; // 课程价格（单位分）
  }

// 教练课程方案 API
export const CoachPlanApi = {
  // 查询教练课程方案分页
  getCoachPlanPage: async (params: any) => {
    return await request.get({ url: `/business/coach-plan/page`, params })
  },

  // 查询教练课程方案详情
  getCoachPlan: async (id: number) => {
    return await request.get({ url: `/business/coach-plan/get?id=` + id })
  },

  // 新增教练课程方案
  createCoachPlan: async (data: CoachPlan) => {
    return await request.post({ url: `/business/coach-plan/create`, data })
  },

  // 修改教练课程方案
  updateCoachPlan: async (data: CoachPlan) => {
    return await request.put({ url: `/business/coach-plan/update`, data })
  },

  // 删除教练课程方案
  deleteCoachPlan: async (id: number) => {
    return await request.delete({ url: `/business/coach-plan/delete?id=` + id })
  },

  /** 批量删除教练课程方案 */
  deleteCoachPlanList: async (ids: number[]) => {
    return await request.delete({ url: `/business/coach-plan/delete-list?ids=${ids.join(',')}` })
  },

  // 导出教练课程方案 Excel
  exportCoachPlan: async (params) => {
    return await request.download({ url: `/business/coach-plan/export-excel`, params })
  },
}